package UMC.Web.UI;

import UMC.Web.UICell;
import UMC.Web.UIClick;
import UMC.Web.WebMeta;

public class UISwitch extends UICell {
    WebMeta webMeta = new WebMeta();


    public UISwitch click(UIClick... click) {
        this.webMeta.put("click", click);
        return this;
    }

    public UISwitch marker(String marker) {

        this.webMeta.put("marker", marker);
        return this;
    }

    public UISwitch text(String fmt) {
        this.format("text", fmt);
        return this;
    }

    public UISwitch setSelected(boolean selected) {
        if (selected) {
            this.webMeta.put("selected", true);
        } else {
            this.webMeta.remove("selected");
        }
        return this;
    }

    @Override
    public UMC.Web.WebMeta data() {
        return webMeta;
    }

    @Override
    public String type() {
        return "Switch";
    }
}
